package com.qf.service.impl;

import com.qf.service.SendReportService;
import com.qianfeng.smsplatform.common.constants.RabbitMqConsants;
import com.qianfeng.smsplatform.common.model.Standard_Report;
import com.qianfeng.smsplatform.common.model.Standard_Submit;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/*
 * @Data: 2021/7/19 21:59
 * */
@Service
public class SendReportServiceImpl implements SendReportService {

    private AmqpTemplate amqpTemplate;
    @Autowired
    public void setAmqpTemplate(AmqpTemplate amqpTemplate) {
        this.amqpTemplate = amqpTemplate;
    }

    @Override
    public void sendSmsReport(Standard_Report report) {

//        将数据发送到接口模块  通知用户
        amqpTemplate.convertAndSend(RabbitMqConsants.TOPIC_PUSH_SMS_REPORT,report);
    }



    @Override
    public void sendSmsToLog(Standard_Submit submit) {
        amqpTemplate.convertAndSend(RabbitMqConsants.TOPIC_SMS_SEND_LOG,submit);
    }
}
